Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

duplicate key value violates unique constraint "name_model_grouping_aggregation_period" #39

Open
kassimhalloyta opened this issue Aug 10, 2015 · 0 comments

Comments

@kassimhalloyta
Copy link

rails 4.2.3
reportable 1.4.2

Get an error for reloading data, looks like cached value is not found by method 'Saulabs::Reportable::ReportCache.build_conditions_for_reading_cached_data'.

Looks like there is a issue when the condition is nil and return quoted Array '[]'.
If i replace quoted Array with empty string from build_conditions_for_reading_cached_data query, it can find the 'cached' data.

 cached_data = read_cached_data(report, options) 
-> []

{:model_class_name=>"Profile", 
:report_name=>"number_of_profiles_falckinos", 
:grouping=>"day", 
:aggregation=>"count", 
:conditions=>"[]"} 
-> []

{:model_class_name=>"Profile", 
:report_name=>"number_of_profiles_falckinos", 
:grouping=>"day", 
:aggregation=>"count", 
:conditions=>""} 
-> #<ActiveRecord::Relation [#<Saulabs::Reportable::ReportCache id: 3138, model_class_name: "Profile", report_name: "number_of_profiles_falckinos", grouping: "day", aggregation: "count", conditions: "", value: 0.0, reporting_period: "2015-08-09 00:00:00", created_at: "2015-08-10 14:19:18", updated_at: "2015-08-10 14:19:18">]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant