Comments (8)
from gdpr_rails.
Hi @mrsweaters , thanks for report this.
I think this could be the !o.prevalidation && !ENV['SKIP_POLICY']
part that is probably bypassing the validation. I would suggest that you put a binding.pry
inside the block in order to debug if the if
check is returning true
indeed
let us know how it goes
from gdpr_rails.
when you pass the "0" values are the user_terms
being persisted on your database ??
from gdpr_rails.
Thanks for the quick reply. Yes, the user_terms
are being persisted as accepted when "0" is passed.
PolicyManager::UserTerm Create (0.3ms) INSERT INTO `policy_manager_user_terms` (`user_id`, `term_id`, `state`, `created_at`, `updated_at`) VALUES (70, 1, 'accepted', '2018-05-23 17:24:29', '2018-05-23 17:24:29') /*application:Enroll,controller:registrations,action:create*/ [sql_query]
PolicyManager::UserTerm Create (0.3ms) INSERT INTO `policy_manager_user_terms` (`user_id`, `term_id`, `state`, `created_at`, `updated_at`) VALUES (70, 2, 'accepted', '2018-05-23 17:24:29', '2018-05-23 17:24:29') /*application:Enroll,controller:registrations,action:create*/ [sql_query]
I also checked the if
block as per your recommendation, but the values are set correctly from what I can tell.
from gdpr_rails.
this line may be the culprit
https://github.com/prey/gdpr_rails/blob/master/app/models/policy_manager/concerns/user_behavior.rb#L34
it seems that the engine does not cast the 0/1 values and only expects a true/false values.
I see that your are using simple_form
, right ? . it seems that simple_form
defaults to 1/0
values for check boxes.
We are going to fix this in order to accept 1/0
or t/f
or true/false
values, but for now I would suggest that for now you implement a block for your input in order to set up true/false values for your checkboxes.
f.input :my_boolean, as: :boolean do
f.check_box :my_boolean, {}, "true", "false"
end
let us know how it goes
from gdpr_rails.
I'm not using simple_form, just Rails built-in form helpers. I changed the inputs to the following but still experience the same issue.
<label>
<%= f.check_box :policy_rule_privacy, {}, "true", "false" %>
You have read and agree to the terms outlined in our <a href="#">Privacy Policy</a>
</label>
<label>
<%= f.check_box :policy_rule_terms_of_service, {}, "true", "false" %>
You have read and agree to the terms outlined in our <a href="#">Terms of Service</a>
</label>
from gdpr_rails.
That did it!
<label>
<%= f.check_box :policy_rule_privacy, {}, true, false %>
You have read and agree to the terms outlined in our <a href="#">Privacy Policy</a>
</label>
<label>
<%= f.check_box :policy_rule_terms_of_service, {}, true, false %>
You have read and agree to the terms outlined in our <a href="#">Terms of Service</a>
</label>
from gdpr_rails.
great that it works. I will keep this open until we fix this.
thanks for report this issue @mrsweaters
from gdpr_rails.
Related Issues (20)
- How to store cookie consent ? HOT 3
- Migrate from Paperclip to ActiveStorage ? HOT 3
- peding_policies should be pending_policies HOT 1
- Accessing and rendering terms HOT 4
- :allow_admins redirects to root_path, which requires admin access HOT 2
- undefined local variable or method `acts_as_messageable'
- Accept dialog HOT 1
- undefined method `has_one_attached' for User HOT 4
- [readme?] Problem when user class has different name than User HOT 1
- Development of invisible option in prey app HOT 3
- Upgrade to Rails6 HOT 3
- Chartkick security vulnerability HOT 2
- Issue with paperclip HOT 3
- No such file to load -- paperclip.rb HOT 6
- Rails version too restrictive for Rails 6 patch releases.
- Rails 6 + Require Paperclip Error? HOT 3
- Broken Concerns name spacing for Controller for rails 6.0.3.x
- Undefined method 'per' error when used with ActiveAdmin
- Dependency tree not resolved with Rails 6.1.4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from gdpr_rails.